﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Admin : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["QuanTri"]!= null)
        {
            quantri = bool.Parse(Session["QuanTri"].ToString());
        }
        else
        {
            Response.Redirect("Login.aspx");
        }
    }
    public bool quantri;
    public bool QuanTri()
    {
        return this.quantri;
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        //int vtLoai = DropDownList1.SelectedIndex;
        //if (vtLoai > 0 && txtTimKiem.Value != "Tìm kiếm")
        //{
        //    string tenSP = txtTimKiem.Value;
        //    string loaiSP = DropDownList1.SelectedValue;
        //    switch (int.Parse(loaiSP))
        //    {
        //        case 1:
        //            Response.Redirect("SearchResult.aspx?LoaiTK="+loaiSP+"&ChuoiTimKiem=" + tenSP);
        //            break;
        //        case 2:
        //            Response.Redirect("SearchResult.aspx?LoaiTK=" + loaiSP + "&ChuoiTimKiem=" + tenSP);
        //            break;
        //        case 3:
        //            Response.Redirect("SearchResult.aspx?LoaiTK=" + loaiSP + "&ChuoiTimKiem=" + tenSP);
        //            break;
        //        case 4:
        //            Response.Redirect("SearchResult.aspx?LoaiTK=" + loaiSP + "&ChuoiTimKiem=" + tenSP);
        //            break;
        //    }

        //}
        //if (vtLoai > 0 && txtTimKiem.Value == "Tìm kiếm")
        //{
        //    // string tenSP = txtTimKiem.Value;
        //    string loaiSP = DropDownList1.SelectedValue;
        //    switch (int.Parse(loaiSP))
        //    {
        //        case 1:
        //            Response.Redirect("SearchResult.aspx?LoaiTK="+loaiSP+"&ChuoiTimKiem=");
        //            break;
        //        case 2:
        //            Response.Redirect("SearchResult.aspx?LoaiTK=" + loaiSP + "&ChuoiTimKiem=");
        //            break;
        //        case 3:
        //            Response.Redirect("SearchResult.aspx?LoaiTK=" + loaiSP + "&ChuoiTimKiem=");
        //            break;
        //        case 4:
        //            Response.Redirect("SearchResult.aspx?LoaiTK=" + loaiSP + "&ChuoiTimKiem=");
        //            break;
        //    }

        //}

        //Response.Redirect("SearchResult.aspx?LoaiTK=&ChuoiTimKiem=");
    }
}
